#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=10010, maxk=14;

int abs(int a) {
  return a<0 ? -a : a;
}

int min(int a, int b) {
  return a<b ? a : b;
}

class Graph {
public:
  int n, m=1, ind[maxn+1], to[4*maxn+1], link[4*maxn+1], val[4*maxn+1];

  void addSide(int u, int v, int w) {
    m++;
    to[m] = v;
    val[m] = w;
    link[m] = ind[u];
    ind[u] = m;
  }
};

class CST{
public:
  int n, m, ind[2*maxn+1], to[4*maxn+1], link[4*maxn+1], val[4*maxn+1], l[2*maxn+1], r[2*maxn+1], f[2*maxn+1][maxk+1][2], dep[2*maxn+1];
  bool square[maxn*2+1];

  void addSide(int u, int v, int w) {
    m++;
    to[m] = v;
    val[m] = w;
    link[m] = ind[u];
    ind[u] = m;
  }

  void build1(int o, int fa, Graph &g) {
    static bool book[maxn+1], flag[4*maxn+1];
    static int stack[maxn+1], side[maxn+1], len[maxn+1];
    book[o] = true;
    stack[++stack[0]] = o;
    for (int i=g.ind[o]; i; i=g.link[i]) {
      if (g.to[i]!=fa && !flag[i]) {
	side[stack[0]] = i;
	if (book[g.to[i]]) {
	  int j;
	  r[o] = g.val[i];
	  l[o] = len[o]-len[g.to[i]];
	  for (j=stack[0]-1; stack[j]!=g.to[i]; j--) {
	    r[stack[j]] = r[stack[j+1]]+len[stack[j+1]]-len[stack[j]];
	    l[stack[j]] = len[stack[j]]-len[g.to[i]];
	  }

	  n++;
	  square[n] = true;
	  for (j=stack[0]; stack[j+1]!=g.to[i]; j--) {
	    flag[side[j]] = true;
	    flag[side[j]^1] = true;
	    addSide(stack[j], n, min(l[stack[j]], r[stack[j]]));
	    addSide(n, stack[j], min(l[stack[j]], r[stack[j]]));
	  }
	} else {
	  len[g.to[i]] = len[o]+g.val[i];
	  build1(g.to[i], o, g);
	  if (!flag[i]) {
	    addSide(g.to[i], o, g.val[i]);
	    addSide(o, g.to[i], g.val[i]);
	  }
	}
      }
    }
    stack[0]--;
    book[o] = false;
  }

  void build2(int o, int fa) {
    dep[o] = dep[fa]+1;
    for (int i=ind[o]; i; i=link[i]) {
      if (to[i]!=fa) {
	f[to[i]][0][0] = o;
	f[to[i]][0][1] = val[i];
	build2(to[i], o);
      }
    }
  }

  void buildFromGraph(Graph &g) {
    n = g.n;
    build1(1, 0, g);
    build2(1, 0);

    for (int j=1; j<=maxk; j++) {
      for (int i=1; i<=n; i++) {
	f[i][j][0] = f[f[i][j-1][0]][j-1][0];
	f[i][j][1] = f[f[i][j-1][0]][j-1][1]+f[i][j-1][1];
      }
    }
  }

  int lca(int &u, int &v) {
    int ret;
    if (dep[u]<dep[v]) {
      ret = u, u = v, v = ret;
    }
    ret = 0;

    for (int i=maxk; i>=0; i--) {
      if (dep[f[u][i][0]]>=dep[v]) {
	ret += f[u][i][1];
	u = f[u][i][0];
      }
    }
    if (u==v) {
      return ret;
    }

    for (int i=maxk; i>=0; i--) {
      if (f[u][i][0]!=f[v][i][0]) {
	ret += f[u][i][1]+f[v][i][1];
	u = f[u][i][0], v = f[v][i][0];
      }
    }
    return ret;
  }
};

int main() {
#ifdef DEBUG
  freopen("src.in", "r", stdin);
  freopen("src.out", "w", stdout);
#endif

  static Graph g;
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  g.n = n;
  for (int i=1; i<=m; i++) {
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    g.addSide(u, v, w);
    g.addSide(v, u, w);
  }

  static CST cst;
  cst.buildFromGraph(g);

  for (int i=1; i<=q; i++) {
    int u, v;
    scanf("%d %d", &u, &v);

    int ans=cst.lca(u, v);
    if (u!=v && cst.square[cst.f[u][0][0]]) {
      ans += min(min(abs(cst.l[u]-cst.l[v]), abs(cst.r[u]-cst.r[v])), min(cst.l[u]+cst.r[v], cst.r[u]+cst.l[v]));
    } else if (u!=v) {
      ans += cst.f[u][0][1]+cst.f[v][0][1];
    }
    printf("%d\n", ans);
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
